#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QMessageBox>
#include "verificationcode.h"

class LoginWidget : public QWidget
{
    Q_OBJECT

public:
    explicit LoginWidget(QWidget *parent = nullptr);
    ~LoginWidget();

private slots:
    void onLoginButtonClicked();
    void refreshVerificationCode();

private:
    QLineEdit *m_usernameEdit;
    QLineEdit *m_passwordEdit;
    QLineEdit *m_codeEdit;
    QPushButton *m_loginButton;
    QPushButton *m_refreshButton;
    VerificationCode *m_verificationCode;

    // 模拟数据库中的用户信息
    const QString VALID_USERNAME = "admin";
    const QString VALID_PASSWORD = "12345";
};

#endif // LOGINWIDGET_H
